package com.micolor.logr.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.micolor.logr.runtime.annotation.*;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author EvanGe
 * @Type UserInfo.java
 * @Desc
 * @date 2024/7/8 10:36
 */
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Data
@TableName("t_user")
@LogComponent("用户信息")
public class UserInfo extends BaseEntity implements Serializable {

    @LogField(value = "用户编号",isBizId = true)
    @TableId(value = "user_id",type= IdType.ASSIGN_UUID)
    private String userId;

    @LogField(value = "用户名称",isBizDesc = true)
    @TableField("user_name")
    private String userName;

    @LogField(value = "用户状态",enumTrans = "dict:sys_yes_no",enumPrecision = false)
    @TableField("user_status")
    private String userStatus;

    @LogField(value = "租户",enumTrans = "tenant" ,enumPrecision = true,isShardingField = true)
    @TableField("tenant_id")
    private String tenantId;

    @LogField(value = "部门")
    @TableField("department_id")
    private String departmentId;
}
